package fr.fermeManager.library.services;

import java.util.List;

import fr.fermeManager.library.dao.DaoTypeTransaction;
import fr.fermeManager.library.dao.DaoTypeTransactionImplDerby;
import fr.fermeManager.library.model.beans.TypeTransaction;

/**
 * 
 * @author Mo
 *
 */
public class TypeTransactionServiceImpl implements TypeTransactionService{
	
	private DaoTypeTransaction daoTypeTransaction = new DaoTypeTransactionImplDerby();

	@Override
	public List<TypeTransaction> getListeTypesTransactions(int idFerme,boolean isAdmin) throws Exception {
		return  daoTypeTransaction.getListeTypesTransactions(idFerme,isAdmin);
	}

	@Override
	public TypeTransaction ajouterTypeTransaction(int idFerme,TypeTransaction nouveauTypeTransac) throws Exception {
		return nouveauTypeTransac = daoTypeTransaction.ajouterTypeTransaction(idFerme,nouveauTypeTransac);
	}

	@Override
	public void modifierTypeTransaction(TypeTransaction typeTransactionSelectionnee) throws Exception {
		daoTypeTransaction.modifierTypeTransaction(typeTransactionSelectionnee);
	}

	@Override
	public void supprimerTypeTransaction(int idTypeTransaction) throws Exception {
		daoTypeTransaction.supprimerTypeTransaction(idTypeTransaction);
	}
	@Override
	public boolean existeTypeTransactionsActifsForFerme(int idFerme) throws Exception {
		return daoTypeTransaction.existeTypeTransactionsActifsForFerme(idFerme);
	}
}
